package com.lxy.util;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

import android.content.Context;


public class MyCityData {
		private Map<String,String> allcity=new HashMap<String,String>();
	    public MyCityData(Context ctx){
	        InputStream inputStream = null;
	        try {
				inputStream = ctx.getAssets().open("city1.txt");
			} catch (IOException e) {
				e.printStackTrace();
			}
	      
	        Scanner sc=new Scanner(inputStream);
	        while(sc.hasNext()){
	            String s=sc.nextLine();
	            if(s==null) continue;
	            if(s.equals("")) continue;
	            String []kv=s.split("=");
	            allcity.put(kv[1].trim(), kv[0]);
	        }
	        
	    }
	    
	    public String getCitys(String cn){
	        return allcity.get(cn);
	    }
	    
	}
